package cn.yunhe.aspect;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
/**
 * aop 切面测试类
 * @author Administrator
 *
 */
@Component
@Aspect
public class DemoAspect {
	Logger logger = LogManager.getLogger(DemoAspect.class);
	@Before("execution(* cn.yunhe.service.impl.*.*(..))")
	public void before(JoinPoint jp) throws Throwable {
		String methodname=jp.getSignature().getName();//获取目标方法名称
		logger.debug(jp+"方法执行  aop: before");
	}
}
